/**
 * 给定x和y，问是否存在正整数a和b使得 
 *   x + ab = y
 * 如果y比x大，令a=1，b=y-x即可
 */
#include <bits/stdc++.h>
using namespace std;

#include <bits/extc++.h>
using namespace __gnu_pbds;

using llt = long long;
using pii = pair<int, int>;
using vi = vector<int>;

int X, Y;

void proc(){
    auto tmp = Y - X;
    if(tmp <= 0) return (void)(cout << "-1 -1\n");
    return (void)(cout << 1 << " " << tmp << endl);
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(0);
    int nofakse = 1;
    cin >> nofakse;
    while(nofakse--){
        cin >> X >> Y;
        proc();
    }
    return 0;
}